﻿package cn.kxm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kxm.dao.CompanyMapper;
import cn.kxm.pojo.Company;
import cn.kxm.pojo.Companydetail;
import cn.kxm.service.CompanyService;

@Service
public class CompanyServiceImpl implements CompanyService{

	@Autowired
	private CompanyMapper cm;
	@Override
	public List<Company> findAll(String code, String name, Integer type,
			Integer page, Integer size) {
		// TODO Auto-generated method stub
		return cm.findAll(code, name, type, page, size);
	}

	@Override
	public int getCount(String code, String name, Integer type) {
		// TODO Auto-generated method stub
		return cm.getCount(code, name, type);
	}
	
	@Override
	public List<Company> getCompanys(List<Integer> types, String name,
			String code, Integer page, Integer size) {
		Integer currPage=(page-1)*size;
		return cm.getCompanys(types, name, code, currPage, size);
	}

	@Override
	public int getCompanyCount(List<Integer> types, String name, String code) {
		return cm.getCompanyCount(types, name, code);
	}
	
	@Override
	public List<Company> getCompanyAll(Company company, Integer pageSize,
			Integer currentPageNo) {
	
		return cm.getCompanyAll(company,pageSize,(currentPageNo-1)*pageSize);
	}
	@Override
	public int getCompanyCountt(Company company) {
		
		return cm.getCompanyCountt(company);
	}

	@Override
	public List<Map<String, Object>> getCompany_Detiail(Company company,
			Integer pageSize, Integer currentPageNo) {
		return cm.getCompany_Detiail(company, pageSize, (currentPageNo-1)*pageSize);
	}

	@Override
	public Map<String, Object> getCompanydetailsByCode(String code) {
		return cm.getCompanydetailsByCode(code);
	}

	@Override
	public int addCompany(Company company) {
		return cm.addCompany(company);
	}

	@Override
	public int addCompanydetail(Companydetail companydetail) {
		return cm.addCompanydetail(companydetail);
	}

	@Override
	public int modifyCompanydetail(Companydetail companydetail) {
		return cm.modifyCompanydetail(companydetail);
	}

	@Override
	public int modifyCompany(Company company) {
		return cm.modifyCompany(company);
	}

	@Override
	public int delCompanydetail(String code) {
		return cm.delCompanydetail(code);
	}

	@Override
	public int delCompany(String code) {
		return cm.delCompany(code);
	}

	@Override
	public int getCompanyCounttt(Company company) {
		return cm.getCompanyCounttt(company);
	}



}
